package org.kojo.tdrm.servlet.ctrl;

import java.io.IOException;
import java.util.logging.Logger;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.kojo.tdrm.service.NotificationAppService;
import org.kojo.tdrm.service.RepeatTaskAppService;

public class NotifyAppController extends BaseController {
	private static Logger log = Logger.getLogger(NotifyAppController.class.getName());
	private NotificationAppService service = new NotificationAppService();
	private RepeatTaskAppService rtService = new RepeatTaskAppService();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		processRequest(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		processRequest(req, resp);
	}

	public void processRequest(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		log.fine("APP -> NotifAppCtrl run");
		
		service.process();
		rtService.process();
		super.setJsonResp("success");
	}
}
